import * as types from "../../mutation-type";

export const countInfo = {
    num: 0
}

const count = (state = countInfo , action) =>{
    let {type, data} = action;

    switch (type) {
        case types.ADD_NUM:
            return {...state, num: data.num}
        case types.SUB_NUM:
            return {...state, num: data.num}
        default:
            return state;
    }
}

export default count;